//
//  YBBaseVC.m
//  YBar
//
//  Created by Rich on 16/4/19.
//
//

#import "RCBaseVC.h"

@interface RCBaseVC ()

@end

@implementation RCBaseVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBarHidden = YES;
    self.view.backgroundColor = BG_COLOR;
    [self createCustomNavigationBar];
//    [self registerForKVO];
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    [MobClick beginLogPageView:NSStringFromClass([self class])];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    [MobClick endLogPageView:NSStringFromClass([self class])];
}

#pragma mark -

- (void)createCustomNavigationBar
{
    if (self.navigationBar == nil) {
        float width = [UIScreen mainScreen].bounds.size.width;
        CGRect rect = CGRectZero;
        if (IOS7_OR_LATER) {
            rect = CGRectMake(0.0f, 0.0f,width, 64.0f);
        } else {
            rect = CGRectMake(0.0f, 0.0f,width, 44.0f);
        }
        _navigationBar = [[CustomNavigationBar alloc] initWithFrame:rect];
        self.navigationBar.delegate = self;
        [self.view addSubview:self.navigationBar];
        
    }
}

@end
